<!--
 * @Description: hong.zhao Create File
 * @Version: 1.0
 * @Author: hong.zhao
 * @Date: 2024-01-12 15:02:09
 * @LastEditors: hong.zhao
 * @LastEditTime: 2024-10-30 16:51:34
-->
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>康约约</title>
    <style>body{background-color: #ffffff;}</style>
</head>

<style>
  .loading-container {
    text-align: center;
    margin-top: 40%;
    color: #111A34;
  }
  
  .loading-spinner {
      animation: spin 2s linear infinite;
  }
  
  @keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
  }
</style>

<body class="wrap">
  <noscript>
      <strong>We're sorry but hysec_app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  </noscript>
  <div class="loading-container">
    <img src="./image/loading_more.gif" width="48px" alt="Loading" class="loading-spinner">
    <div style="margin-top:15px; letter-spacing: 2px;">
      <span>系统正在初始化。。。</span>
    </div>
  </div>
</body>

<script src="https://yaoyueyueoss.yaoyueyue.com/apiReadyInit/apiReadyInit.js"></script>

<script type="text/javascript">
  function init(num){
    var localversion = window.h5version || null // 这个版本是通过version与hyyx版本好组合而成的版本号
    var appId = api.appId // 'A6031931797561'
    var isDev = !!window.isDev

    if( typeof apireadyInit === 'function' ){
      return apireadyInit(localversion, appId, isDev)
    }

    // 如果7次尝试之后，依旧没有apireadyInit函数，则说明脚本没有加载成功或者网络卡顿，则使用本地资源
    if(num > 7 && typeof apireadyInit != 'function'){
      // 打开本地目录下的dist
      api.openWin({
        name: 'defaultSys',
        url: './dist/index.html',
        bgColor: '#ffffff',
        scrollToTop: true,
        scrollEnabled: false,
        softInputDismissMode: ['tap', 'drag'],
        slidBackEnabled: false
      })
      return
    }

    retryInit(num + 1)
  }

  // 重复初始化，尝试判断资版本信息是否加载完成
  function retryInit(num){
    setTimeout(function(){
      init(num)
    }, 1500)
  }

  apiready = function(){
    //   删除启动页面-天宏要求不再删除启动页，进入应用之后再删除
    // api.removeLaunchView({
    //     animation: { type: "fade", duration: 500 }
    // })
    init(1)
  }
</script>

<!-- 放在html文本最后，避免资源未找到导致的卡启动页 -->
<script src="./dist/h5version.js"></script>

</html>
